package homework008;

public enum GoodsAttrEnum {
    FENBIAN("分辨率", "attr1"), TYPE("类型", "attr2"), SYSTEM("系统", "attr3"), THICKNESS("厚度", "attr4");

    private String name;
    private String en;

    private GoodsAttrEnum(String name, String en) {
        this.name = name;
        this.en = en;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEn() {
        return en;
    }

    public void setEn(String en) {
        this.en = en;
    }

    public static String getByEn(String en) {
        GoodsAttrEnum[] values = GoodsAttrEnum.values();
        for (GoodsAttrEnum value : values) {
            if (en.equals(value.getEn())) {
                return value.getName();
            }
        }

        return "";
    }
}
